<template>
	<view class="container">
		<view class="order-status">
			{{ orderDetail.status == 0 ? '已取消' : orderDetail.status == 1 ? '待确认接单' : orderDetail.status == 2 ? '待开工' : orderDetail.status == 3 ? '进行中' : orderDetail.status == 4 ? '待结算' : orderDetail.status == 5 ? '已完成' : orderDetail.status == 7 ? '等待雇员同意' : orderDetail.status == 8 ? '等待雇主开工确认' : orderDetail.status == 9 ? '待同意' : ''}}
			<text v-if="orderDetail.status==3">已工作 {{workTime}}分钟</text>
			<view v-if="orderDetail.status==2">请在 {{orderDetail.detectionTime|toFil}}前开工</view>
		</view>
		<view class="main"
			:style="{'margin-bottom': orderDetail.status != 1 && orderDetail.status != 0 && orderDetail.status != 4 ? '130rpx' : 0}">
			<!-- 雇员的订单详情-->
			<view class="info employer-area">
				<view class="title">雇主</view>
				<view class="employer-info" @click="handleOpenBossDetail(orderDetail.taskUser.user.userId)">
					<view>
						<image :src="imgPath + orderDetail.taskUser.user.avatar+'?imageView2/1/w/80/h/80'"
							mode="aspectFill"></image>
						<view>
							<view>
								<text>{{ orderDetail.taskUser.user.userName }}</text>
								<view v-if="orderDetail.taskUser.user.sex==0" class="sex-nan">
									<image class="sex-image"
										src="https://images.linglinggong.net/static/icon3/nna1111.png"
										mode="aspectFill"></image>
									{{!orderDetail.taskUser.user.age ? '未知' : orderDetail.taskUser.user.age}}
								</view>
								<view v-if="orderDetail.taskUser.user.sex==1" class="sex-nv">
									<image class="sex-image"
										src="https://images.linglinggong.net/static/icon3/nv111.png" mode="aspectFill">
									</image>
									{{!orderDetail.taskUser.user.age ? '未知' : orderDetail.taskUser.user.age}}
								</view>
							</view>
							<view class="cxDiv">
								<view class="cx">
									<text>评分</text>
									<text>{{ orderDetail.taskUser.integrity}}</text>
								</view>
								<text class="fg">|</text>
								<view class="cx">
									<text>好评率</text>
									<text>{{ orderDetail.taskUser.user.haoping }}%</text>
								</view>
							</view>
						</view>
					</view>
					<view>
						<text>成交单数</text>
						<text>{{ orderDetail.taskUser.issuanceNum }}</text>
					</view>
				</view>
				<view class="buttons" v-if="chatFlag==true">
					<view class="button" @click="handOpenChat">在线聊天</view>
					<view class="button" @click="handleMakePhoneCall">{{getPhone?'拨打电话':'客服电话'}}</view>
				</view>
			</view>
			<view class="info job-info">
				<view class="job-name" style="margin-top: 0px;">
					<view>{{ orderDetail.taskName }}</view>
					<view class="task-reward" :style="{color: orderDetail.vipFlag ? '#4E9800' : '#FF650C'}">
						{{orderDetail.taskType==0 ? (orderDetail.reward + orderDetail.subsidy) : orderDetail.reward}}{{ orderDetail.taskType===0 ? '元/小时' : orderDetail.taskType===1 ? '元/件' : orderDetail.taskType===2 ? '元/天' : ''}}<text
							v-if="taskDetail.floorsstr==1"
							class="floorsstr-view">保底{{taskDetail.floorsAmount/100}}元/小时</text>
					</view>
					<!-- 补贴 -->
					<view class="subsidy" v-if="orderDetail.vipFlag && orderDetail.subsidy && orderDetail.taskType">补:
						{{orderDetail.subsidy}}元 </view>
				</view>
			</view>
			<view class="info order-info" style="display: flex;justify-content: space-between;align-items: center;">
				<view style="width: 100%;display: flex;">
					<text>开工时间&emsp;&emsp;</text>
					<view>{{ orderDetail.startTime ? orderDetail.startTime.slice(0, 16) : '' }} —
						{{ orderDetail.endTime ? orderDetail.endTime.slice(10, 16) : ''}}</view>
				</view>
				<view class="xi-gs" v-if="false"></view>
			</view>
			<!-- 干活信息 -->
			<view class="info job-info" style="position: relative;z-index:0;">
				<view class="title">干活信息</view>
				<view class="job-detail" style="border-bottom: 0px solid #F2F2F2;">
					<view @click="handleMap" v-if="orderDetail.status!=0&&orderDetail.status!=5">
						<text>干活地点</text>
						<view>
							{{ (orderDetail.status === 1 || orderDetail.status === 0 || orderDetail.status === 5)  ? getShowAdd(orderDetail.taskAddress) : orderDetail.taskAddress }}
						</view>
						<image class="anim-dingwei" src="https://images.linglinggong.net/static/dingwei.png"
							mode="aspectFit"></image>
					</view>
					<view>
						<text>干活时间</text>
						<text>{{ orderDetail.taskStartTime.slice(0, 16) }}{{' - '}}{{isTaskTomorrowFlag?'次日':''}}{{ orderDetail.taskEndTime.slice(10, 16) }}</text>
					</view>
					<view>
						<text>需要人数</text>
						<text>{{ orderDetail.taskNumber }}人</text>
					</view>
					<view>
						<text>岗位要求</text>
						<text>{{ taskDetail.taskContent }}</text>
					</view>
					<!-- 					<view v-if="orderDetail.taskType == 1&&(orderDetail.status==0||orderDetail.status==4||orderDetail.status==5)">
						<text>完成件数</text>
						<text>{{ orderDetail.finishCount ? orderDetail.finishCount : 0 }}件</text>
					</view> -->
					<!-- 补贴 -->
					<!-- 	<view class="subsidy" v-if="orderDetail.vipFlag && orderDetail.subsidy">
						<text>补贴金额</text>
						<text>{{orderDetail.subsidy}}{{orderDetail.taskType ? '元' : '元/小时'}}</text>
					</view> -->
					<view
						v-if="orderDetail.taskType == 1&&(orderDetail.status==0||orderDetail.status==4||orderDetail.status==5)">
						<text>计件工资</text>
						<text
							:style="{color:orderDetail.baodiGz>orderDetail.finishAmount ?'#402110':'#E62B00'}">{{ orderDetail.finishAmount ? orderDetail.finishAmount : 0 }}元</text>
					</view>
					<!-- 计件的保底工时 -->
					<view
						v-if="orderDetail.taskType===1&&taskDetail.floorsstr===1&&orderDetail.baodiGz>orderDetail.finishAmount&& orderDetail.status == 4">
						<text>保底工资</text>
						<text
							:style="{color:orderDetail.baodiGz>orderDetail.finishAmount ?'#E62B00':'#402110'}">{{orderDetail.baodiGz}}元</text>
					</view>
					<view v-if="orderDetail.taskType == 0">
						<text>工资小计</text>
						<text>{{ orderDetail.finishAmount ? orderDetail.finishAmount : 0 }}元</text>
					</view>
				</view>
				<!-- isShowgzTy==0 -->
				<view class="dao-ji-shi" style="position: absolute;right: 3%;bottom:5%;"
					v-if="isShowDaojishi && myTyTime>0">
					<count-down-circle ref="countDown" :second="myTyTime/1000" :second2="myTyTime" type='circle'
						:radius="46" @end="endDjs"> </count-down-circle>
				</view>
				<!-- <view class="job-name">
					<view>{{ orderDetail.taskName }}</view>
					<view class="task-reward" :style="{color: orderDetail.vipFlag ? '#4E9800' : '#FF650C'}">
						{{orderDetail.taskType==0 ? (orderDetail.reward + orderDetail.subsidy) : orderDetail.reward}}{{ orderDetail.taskType===0 ? '元/小时' : orderDetail.taskType===1 ? '元/件' : orderDetail.taskType===2 ? '元/天' : ''}}
					</view>
					<!-- 补贴 -->
				<!-- <view class="subsidy" v-if="orderDetail.vipFlag && orderDetail.subsidy && orderDetail.taskType">补: {{orderDetail.subsidy}}元</view>
				</view> -->
				<!-- 服务费率为0时，不展示 -->
				<view class="tip" v-show="rate">
					<view>
						<text>温馨提示</text>
					</view>
					<text>注: 平台将抽取{{rate}}%的服务费</text>
				</view>
			</view>
			<!-- 订单信息 -->
			<view class="info order-info">
				<view class="title">订单信息</view>
				<view>
					<text>创建时间</text>
					<text>{{ orderDetail.createTime }}</text>
				</view>
				<view>
					<text>订单编号</text>
					<text>{{ orderDetail.orderNo }}</text>
				</view>
			</view>
		</view>
		<!-- 按钮 -->
		<view :class="['fix-buttons',  orderDetail.status !== 7&&orderDetail.isExpel==true?'fix-button2':'' ]  "
			v-if="orderDetail.status != 9 && orderDetail.status != 0 && orderDetail.status != 4 && orderDetail.isEmployeeEvaluate !=1">
			<view class="buttonText" v-show="showTip" @click.stop="onGo()"> 辞工 </view>
			<view
				@click.stop="handleOpenModal(0, orderDetail.status, orderDetail.taskType,null,null,null,null,null,null,orderDetail.isExpel)"
				class="button " v-if="orderDetail.status != 5&&orderDetail.status !=1 && orderDetail.isExpel!=false"
				:style="{color:orderDetail.isExpel==true ? '#787878':''}">
				{{orderDetail.status == 7 ? '拒绝' : orderDetail.isExpel==true?'···':'取消'}}
			</view>
			<!-- 		<view class="fix-buttons fix-button2">
				<view class="buttonText" v-show="showTip" @click.stop="onGo()"> 辞工 </view>
				<view @click.stop="onCigong(orderDetail.id)" class="button"></view>
			</view> -->
			<view @click.stop="handleOpenModal(0, orderDetail.status, orderDetail.taskType)" class="button"
				v-if="orderDetail.status ==1">
				{{orderDetail.status == 7 ? '拒绝' : '取消'+invitationCountDown(orderDetail.createTime,1)+countDown }}
			</view>
			<view class="nullListMsg"
				v-if="!isShowDaojishi &&orderDetail.isCheck==1 && orderDetail.status==2 && orderDetail.applyNum !==3">
				<view>您还有{{3-orderDetail.applyNum}}次申请机会</view>
				<view></view>
			</view>
			<view
				@click.stop="handleOpenModal(1, orderDetail.status, orderDetail.id , orderDetail.taskType, (orderDetail.reward+orderDetail.subsidy), orderDetail.startTime,orderDetail.taskStartTime,orderDetail.taskEndTime,orderDetail.levelsd,null,orderDetail.createBy,imgPath+orderDetail.taskUser.user.avatar,orderDetail)"
				class="button"
				v-if="!isShowDaojishi && orderDetail.applyNum !==3 && ((orderDetail.status==5&&(orderDetail.isEmployeeEvaluate==0)) || orderDetail.status == 2 || (orderDetail.status == 3&&orderDetail.isExpel!=true) || orderDetail.status == 1 || orderDetail.status == 7)"
				:style="{background: orderDetail.status == 7 ? '#4E9800' : '#F39B19', border: orderDetail.status == 7 ? '#4E9800' : '#F39B19',color: (orderDetail.status == 3&&orderDetail.isExpel==false) ? '#FFF':''}">
				{{orderDetail.status == 7 ? '同意'+invitationCountDown(orderDetail.createTime,2)+countDown : orderDetail.status == 2 && orderDetail.isCheck==0? '开工' : orderDetail.status == 2 && orderDetail.isCheck==1? '申请开工' : orderDetail.status == 3 ? '收工' : (orderDetail.status == 5 && (orderDetail.isEmployeeEvaluate==0)) ? '评价' : orderDetail.isOldStaff||orderDetail.disturbstatus==1?'直接接单':orderDetail.isConfirm?'确认接单':'拨打电话'}}
			</view>
			<view class="nullListMsg" v-if="isShowDaojishi && myTyTime>0" style="right: 2%;">
				<view style="width: 380rpx;font-size: 24rpx;letter-spacing: 0;">倒计时结束，开工申请自动同意</view>
				<view></view>
			</view>
			<view class="button" v-if="orderDetail.applyNum==3 && orderDetail.status==2 && myTyTime==0"
				@click="kefu_phone()">联系客服</view>
			<view class="button" v-if=" isShowDaojishi && myTyTime>0 ">待雇主确认</view>
		</view>
		<view class="fix-buttons-lahei" v-if="orderDetail.status == 0&&orderDetail.report==0">
			<view @click.stop="handleOpenModal(13,orderDetail.status, orderDetail.id)" class="button">举报</view>
			<view @click.stop="onblock(orderDetail.taskUserId)" class="button">拉黑</view>
		</view>
		</u-popup>
		<u-popup round=24 :show="isShowIncome" mode="bottom" @close="isShowIncome=false" @open="open">
			<view class="shougong">
				<view class="shougong-title">确认收工</view>
				<view class="shougong-tip"> 为了避免纠纷,请于雇主核实数量后再填写 </view>
				<view class="shougong-form">
					<text class="shougong-form-text">完成件数</text>
					<view class="shougong-form-input">
						<input class="shougong-form-input-o" type="number" v-model="count" @input="handleInput" />件
					</view>
				</view>
				<view class="shougong-form">
					<text class="shougong-form-text">计件单价</text>
					<text class="income-content-text-jiage">{{income_reward}}元/件</text>
				</view>
				<view class="shougong-form">
					<text class="shougong-form-text">计件工资</text>
					<text class="income-content-text-zongji"
						:style="{color:isShowBaodi_reward?'#000000':'#FF4600'}">{{income_money}}元</text>
				</view>
				<view class="shougong-footer">
					<view @click="close_ShowIncome()">取 消</view>
					<view @click="income_click()" style="font-weight: 600;">确 认</view>
				</view>
			</view>
		</u-popup>
		<u-modal @cancel="isShowKgConf=false" @confirm="handleSqKg" title="是否申请开工" width="580rpx" cancelText="取消"
			confirmText="确认" confirmColor="#F39B19" :show="isShowKgConf" showCancelButton>
			<view class="slot-content">
				<text style="font-size: 28rpx;padding-bottom: 0;color: #FF7357;">注：该雇主开启了开工审核功能</text>
			</view>
		</u-modal>
		<!-- 强制收工  isShouGong-->
		<view class="mask  mask2" v-if="isShouGong">
			<view class="income-content" @click.stop="isShouGong=false">
				<view class="income-content-text">提前收工提示</view>
				<view class="income-content-text2"> 请确认雇主是否允许您收工！ </view>
				<view class="income-content-baodi-view  btn-text2">私下收工，您的账号将会有封禁风险</view>
				<view class="income-content-text-button">
					<view class="income-content-text-button-ok2" @click="handleRight(0)"
						style="color: #7F7F7F!important;">已沟通，可以收工</view>
					<view class="income-content-text-button-cancel" @click="isShouGong=false"
						style="color: :#262626;!important;border-right: none">取消</view>
				</view>
			</view>
		</view>
		<!-- 弹窗 -->
		<modal :isShowModal="isShowModal" :modalStytle="modalStytle" :unitPrice="unitPrice" :workTime="workTime"
			:workPrice="workPrice" :jobType="jobType" :jobleve="jobleve" @handleLeft="handleLeft"
			@handleRight="handleRight" @input="handleInput" :titleContect="titleContect" :middleContext="middleContext"
			:leftContext="leftContext" :rightContext="rightContext" :contentColor="contentColor"
			:contentsColor="contentsColor"></modal>
		<sealModel v-if="isShowSealAlert" :day="sealDay" @handleLeft="isShowSealAlert=false"
			@handleRight="handleRight()"></sealModel>
		<kefu v-if="isShowKefu" @closePage="isShowKefu=false"></kefu>
		<pingjia v-if="isShowpingjia" @close="closePj()" :userList="pj_user_list"></pingjia>
	</view>
</template>
<script>
	import sealModel from '@/components/xjbg/sealModel.vue'
	import chat from '@/libs/chat.js'
	import format from '@/libs/day-format.js'
	import modal from '@/components/modal/modal.vue'
	import kefu from '../../components/xjbg/kefu.vue'
	import Voice from '@/libs/QS-baiduyy.js'
	import countDownCircle from '@/components/e-countDownCircle/e-countDownCircle.vue'
	import permission from '@/libs/permission.js' //权限插件
	import AudioPlayer from 'untils/audio-player.js';
	import {
		isTaskTomorrow,
		he_evaluate_lv,
		isToDay,
		getSealDay,
		isResidueTimeByMinute,
	} from '@/libs/unit.js'
	export default {
		components: {
			modal,
			sealModel,
			kefu,
			countDownCircle
		},
		data() {
			return {
				showTip: false,
				toDay: '', //当前时间
				x_hours_no_order: '', //雇员取消x小时内不可接单
				order_user_cancel_cut_integrity: '', //雇员取消订单扣除诚信值
				modalStytle: 3, //0-left-text,1-two-line,2-hasInput, 3-middle-context
				isShowModal: false, //是否显示弹框
				titleContect: '', //弹框标题
				middleContext: '', //弹框中间的内容
				unitPrice: 0, //计件单价
				workTime: '0', //计时工作时间
				workPrice: 0, //工作单价
				jobleve: 0,
				leftContext: '取消', //弹框按钮左边的内容
				rightContext: '确认', //弹框按钮右边的内容
				button: 1, //按钮类型
				clickStatus: 0, //工作状态
				jobType: 0, //工作类型0计时工，1：计天工，2计件工
				rate: 4, //平台将抽取的服务费率
				id: '', //订单id
				imgPath: '', //图片路径slice
				orderDetail: { //订单详情
					taskStartTime: '',
					taskEndTime: '',
					taskUser: {
						user: {},
					},
				},
				taskDetail: {}, //任务详情
				count: '', //收工雇员输入的计件件数
				chatFlag: true, //展示聊天框
				getPhone: true, //判断是打客服电话还是雇主电话,true是雇主电话
				serviceTelephone: "0579-85581998", //客服电话
				timer: '',
				timer2: '',
				nn: 10,
				countDown: '',
				quxiaoFlag: 1,
				isShowIncome: false,
				income_money: 0,
				income_reward: 0,
				baodi_reward: 0,
				isShowBaodi_reward: false,
				isTaskTomorrowFlag: false,
				sealDay: 3, //禁封天数
				isShowSealAlert: false,
				expel_time: 30,
				contentColor: '',
				contentsColor: '',
				isShowKefu: false,
				isShowpingjia: false,
				pj_user_list: [],
				isShowKgConf: false,
				isShowgzTy: 1,
				isShowDaojishi: false,
				myTyTime: 0,
				nowTime: 0,
				userInf: uni.getStorageSync('userInfo'),
				isShouGong: false,
				undoneToDay: '', //当前时间
				timerId: null,
				uploadToken: '', // 上传七牛云token
				qiniuyunFile: '', // 上传七牛云获取的key
				isFace: '', //是否开启人脸打卡,1开启0关闭
			}
		},
		filters: {
			toFil(e) {
				return e.toString().substring(10, 16).split('-').join(':')
			}
		},
		methods: {
			// 判断人脸打卡是否开启
			async property_list_by_type_and_key() {
				let res = await this.$fetch(this.$api.property_list_by_type_and_key, {
					type: 1,
					key: 'task_user_auth_flag'
				}, 'POST')
				if (res.code != 0) {
					return
				}
				this.isFace = res.data
			},
			// 上传图片至七牛
			uploadImgs(urls) {
				uni.showLoading({
					title: '人脸验证中~~~',
					mask: true
				})
				let _this = this
				let date = new Date()
				let year = String(date.getFullYear()) //获取完整的年份(4位)
				let month = String(date.getMonth() + 1) //获取当前月份(0-11,0代表1月)
				let strDate = String(date.getDate()) // 获取当前日(1-31)
				if (date.getMonth() + 1 < 10) {
					month = `0${month}`
				} // 如果月份是个位数，在前面补0
				if (date.getDate() < 10) {
					strDate = `0${strDate}`
				} // 如果日是个位数，在前面补0
				let time = year + month + strDate
				console.log(time, year, 'vbkdflnb')
				let ext = urls.split(".").pop()
				// console.log(urls.split(".").pop())
				// let ext = urls.substring((urls.length-26),urls.length)
				uni.uploadFile({
					url: this.$api.uploadPic,
					name: 'file',
					filePath: urls,
					formData: {
						token: this.uploadToken,
						key: 'task/user/faceClock/' + time + '/' + this.$u.guid() + "." + ext
					},
					success: ({
						data
					}) => {
						data = JSON.parse(data)
						this.qiniuyunFile = data.key
						this.getLocationAndWork();
						uni.$emit('openWorking', {})
						uni.$emit('closeDaikgong', {})
					}
				})
			},
			// 获取七牛上传TOKEN
			async get_qiniu_token() {
				let res = await this.$fetch(this.$api.get_qiniu_token, {}, 'POST')
				this.uploadToken = res.msg
			},
			// 刷新列表重置定位缓存
			refreshLocation() {
				console.log('定位')
				uni.getLocation({
					type: 'gcj02',
					success: (res) => {
						uni.setStorageSync('taskListLocation', [res.latitude, res.longitude]);
					},
				})
			},
			async getLocatime() {
				let res = await this.$fetch(this.$api.get_locatime, {}, 'GET')
				this.nowTime = res.data
				let day_0 = new Date(this.nowTime);
				day_0.setDate(day_0.getDate());
				this.undoneToDay = day_0.format("yyyy-MM-dd hh:mm:ss")
			},
			undoneGetToday() {
				this.getLocatime()
			},
			// // 辞工
			async onCigong() {
				this.showTip = !this.showTip
			},
			// 辞工
			onGo() {
				uni.navigateTo({
					url: '/pages/ciGong/ciGong?orderId=' + this.id
				})
			},
			// 刷新
			refresh() {
				this.order_detail()
			},
			closeKgR() {
				this.refresh()
			},
			endDjs() {
				// this.isShowgzTy = 1
				this.myTyTime = 0
				this.isShowDaojishi = false
				setTimeout(() => {
					this.refresh()
				}, 10)
			},
			// 开工倒计时
			kgCountDown(time) {
				let date = new Date(time.replace(/-/g, '/'))
				let time1 = Date.parse(date) / 1000
				let time2 = time1 + 900
				let time3 = Date.parse(new Date()) / 1000
				let time4 = (time2 - time3)
				this.myTyTime = time4 * 1000 > 0 ? time4 * 1000 : 0
			},
			async handleSqKg() {
				// 请求接口申请开工
				let res = await this.$fetch(this.$api.apply_work, {
					orderId: this.orderDetail.id,
					lat: this.userInf.user.lat,
					lng: this.userInf.user.lng
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.kgCountDown(res.data.applyTime)
				this.isShowDaojishi = true
				this.isShowKgConf = false
			},
			async getLocatime() {
				let res = await this.$fetch(this.$api.get_locatime, {}, 'GET')
				// console.log('获取当前时间',res.data)
				this.nowTime = res.data
				let day_0 = new Date(this.nowTime);
				day_0.setDate(day_0.getDate());
				this.toDay = day_0.format("yyyy-MM-dd hh:mm:ss")
			},
			// 获取任务详情
			async task_detail(taskId) {
				let res = await this.$fetch(this.$api.task_detail, {
					taskId: taskId
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.taskDetail = res.data
			},
			//打开地图
			handleMap() {
				uni.navigateTo({
					url: '/pages/map-job/map-job?lat=' + this.taskDetail.lat + '&lng=' + this.taskDetail.lng +
						'&address=' + this.taskDetail.address + '&name=' + this.taskDetail.name,
				})
			},
			//获取展示地址
			getShowAdd(add) {
				add = add.split('·')
				add.pop()
				return add.join('·')
			},
			kefu_phone() {
				uni.makePhoneCall({
					phoneNumber: uni.getStorageSync('property_list_by_type').telephone
				})
			},
			// 打开雇主详情
			handleOpenBossDetail(id) {
				uni.navigateTo({
					url: '/pages/employer-detail/employer-detail?bossId=' + id
				})
			},
			// 返回上级页面
			handleBeforePage() {
				uni.navigateBack({
					delta: 1
				})
			},
			//聊天
			handOpenChat() {
				uni.showToast({
					title: '请手机下载找零工APP',
					icon: 'none'
				})
			},
			// 拨打电话
			handleMakePhoneCall() {
				if (this.orderDetail.taskUser.user == {} || this.id == "") {
					setTimeout(() => {
						this.handleMakePhoneCall()
					}, 2000)
				} else {
					if (this.getPhone) {
						let phone = this.taskDetail.phonenumber ? this.taskDetail.phonenumber : this.taskDetail.telephone
						this.phone_bind_middle_number(phone, this.id)
					} else {
						this.isShowKefu = true
					}
				}
			},
			//获取虚拟电话
			async phone_bind_middle_number(telephone, id) {
				let cont = "是否拨打电话"
				let phone = telephone
				let res = await this.$fetch(this.$api.phone_bind_middle_number, {
					phone: telephone,
					orderId: id
				}, 'POST', 'form')
				console.log('获取虚拟电话res~~~~~~', res)
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				cont = '本次通话为虚拟号码，仅限本次交易中使用。请勿在通讯录中重拨！'
				phone = res.data.middleNumber
				uni.showModal({
					title: '提示',
					content: cont,
					success: (re) => {
						if (re.confirm) {
							uni.makePhoneCall({
								phoneNumber: phone
							})
						} else if (re.cancel) {
							// console.log('用户点击取消')
						}
					}
				})
			},
			//获取客服电话
			async getServiceTelephone() {
				let res = await this.$fetch(this.$api.property_list_by_type, {
					type: 1
				}, 'POST')
				// 客服电话
				uni.setStorageSync('serviceTelephone', res.data.telephone)
				this.serviceTelephone = uni.getStorageSync('serviceTelephone')
			},
			// 获取订单详情
			async order_detail() {
				/* console.log("11111111111111") */
				let res = await this.$fetch(this.$api.order_detail, {
					orderId: this.id
				}, 'POST')
				/* console.log(res) */
				this.getToday() //计算工作时间
				//	 this.calWorkTime(res.data.startTime) //计时工作时间
				if (res.data.startTime != null) {
					this.calWorkTime(res.data.startTime) //计时工作时间
				}
				/* 	console.log(this.workTime) */
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				// 整理数据,res.data的item为null，则改为""
				Object.getOwnPropertyNames(res.data).forEach(function(key) {
					res.data[key] = res.data[key] == null ? '' : res.data[key]
				})
				if (res.data.status == 3) {
					res.data.isExpel = 10 > (isResidueTimeByMinute(res.data.startTime, this.nowTime) * -1)
				}
				// 将金额除以100，单位变为元
				this.isTaskTomorrowFlag = isTaskTomorrow(res.data.taskStartTime, res.data.taskEndTime)
				res.data.floorsAmount = res.data.floorsAmount ? res.data.floorsAmount.divide(100) : 0
				res.data.reward = res.data.reward.divide(100)
				res.data.subsidy = res.data.subsidy ? res.data.subsidy.divide(100) : 0
				res.data.taskUser.integrity = parseFloat(res.data.taskUser.integrity).divide(100)
				res.data.finishAmount = res.data.finishAmount ? res.data.finishAmount.divide(100) : 0
				await he_evaluate_lv(res.data.taskUser.user.userId).then((v) => {
					res.data.taskUser.user.haoping = v
				})
				this.orderDetail = res.data
				this.income_reward = this.orderDetail.reward
				this.task_detail(this.orderDetail.taskId)
				if (this.orderDetail.applyState == 1 && this.orderDetail.applyTime) {
					this.kgCountDown(this.orderDetail.applyTime)
					this.isShowDaojishi = true
				} else {
					this.myTyTime = 0
					this.isShowDaojishi = false
				}
				if (this.orderDetail.status == 5) {
					this.getPhone = false
				}
				if (this.orderDetail.status == 3) {
					// this.refresh1()
				}
				uni.stopPullDownRefresh()
				// this.isShowgzTy = this.orderDetail.isCheck
				// console.log('是否申请开工状态',this.orderDetail.isCheck)
				let hourD = this.orderDetail.endTime.slice(11, 13) - this.orderDetail.startTime.slice(11, 13)
				let minuteD = this.orderDetail.endTime.slice(14, 16) - this.orderDetail.startTime.slice(14, 16)
				this.orderDetail.workTimes = hourD * 60 + minuteD
				this.orderDetail.baodiGz = Math.round((this.orderDetail.floorsAmount * this.orderDetail.workTimes) /
					60 * 100) / 100
				/* console.log('this.orderDetail.updateTime', this.orderDetail.updateTime) */
				if (this.orderDetail.status == 5) {
					this.chatFlag = this.calcWorkTime(this.orderDetail.updateTime) > 2 ? false : true
				} else if (this.orderDetail.status == 0) {
					this.chatFlag = false
				}
				let receivedInfoList = uni.getStorageSync('ReceivedInfo') ? uni.getStorageSync('ReceivedInfo') : []
				if (this.orderDetail.status == 1 && receivedInfoList.length > 0) {
					receivedInfoList.forEach(v => {
						if (v[0] == this.orderDetail.taskId) {
							this.orderDetail.isConfirm = v[1]
							this.orderDetail.isOldStaff = v[2]
						}
					})
				}
			},
			// 计算完成订单时长
			calcWorkTime(end) {
				let endT = end.replace(/-/g, '/')
				let today = this.nowTime
				endT = new Date(endT).getTime()
				/* console.log('完成订单时间 end,endT', end,endT, '当前时间',today) */
				let differenceT = (today - endT) / (1000 * 60 * 60) //小时
				/* console.log('时间差',differenceT) */
				return differenceT
			},
			// 拉黑
			async onblock(taskUserId) {
				if (this.timerId) {
					uni.showLoading({
						title: '太快了,稍后再操作吧!',
						icon: 'none'
					});
					return
				} //判断定时器是否存在，如果存在直接跳出函数不执行下面代码
				//定时器时间到了的时候清楚定时器并且把赋值的变量清空
				this.timerId = setTimeout(() => {
					clearTimeout(this.timerId);
					uni.hideLoading()
					this.timerId = null;
				}, 2000)
				let res = await this.$fetch(this.$api.order_heimingdan, {
					touserId: taskUserId
				}, 'POST')
				if (res.code) {
					uni.showToast({
						title: res.msg
					})
					return
				}
				uni.showToast({
					title: '加入黑名单成功',
					icon: 'none'
				})
			},
			//打开弹框
			async handleOpenModal(button, status, orderId, taskType, reward, startTime, taskStartTime, taskEndTime,
				levelsd, isExpel, createBy, bossPhoto, detail = null) {
				if (this.timerId) {
					uni.showLoading({
						title: '太快了,稍后再操作吧!',
						icon: 'none'
					});
					return
				} //判断定时器是否存在，如果存在直接跳出函数不执行下面代码
				//定时器时间到了的时候清楚定时器并且把赋值的变量清空
				this.timerId = setTimeout(() => {
					clearTimeout(this.timerId);
					uni.hideLoading()
					this.timerId = null;
				}, 2000)
				this.refreshLocation()
				/* console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') */
				// console.log('button',button, 'status',status, 'taskType', taskType)
				this.button = button
				this.clickStatus = status
				this.jobType = taskType
				if (status != 5) {
					this.isShowModal = true
					if (button == 1 && status == 7) { //同意
						this.getRate()
						this.modalStytle = 0
						this.titleContect = '确认订单'
						this.middleContext = '接单成功后，如果取消订单，会导致' + this.sealDay + '天不可再次接单。'
						this.leftContext = '取消'
						this.rightContext = '确认'
					} else if (button == 0 && status == 7) { //拒绝
						this.modalStytle = 3
						this.titleContect = '拒绝邀请'
						this.middleContext = '是否拒绝邀请'
						this.leftContext = '取消'
						this.rightContext = '确认'
					} else if (button == 1 && status == 2) { //开工
						if (detail.isCheck == 1) {
							this.isShowModal = false
							this.isShowKgConf = true
							return
						}
						this.modalStytle = 3
						this.titleContect = '确认订单'
						this.middleContext = '是否开工'
						this.leftContext = '取消'
						this.rightContext = '确认'
					} else if (button == 0 && status != 7 && status != 1 && isExpel != true) { //所有取消
						this.isShowModal = false
						this.isShowSealAlert = true
						// this.getRate()
						// this.modalStytle = status == 1 ? 3 : 0
						// this.titleContect = '取消订单'
						// this.middleContext = status == 1 ? '是否取消订单' : '雇主正在等待您的开工，取消任务将会对您的账号进行限制！'
						// /* 	console.log('this.middleContext',this.middleContext) */
						// this.leftContext = '取消'
						// this.rightContext = '确认'
					} else if (button == 0 && status != 7 && status != 1 && isExpel == true) { //辞工
						// this.getRate()
						// this.modalStytle = 98
						// this.titleContect = '辞工'
						// this.middleContext = '你将无责辞工，#但不会被结算工资，请谨慎处理#'
						// this.leftContext = '取消'
						// this.rightContext = '确认'
						// this.contentColor = '#787878'
						// this.contentsColor = '#FE4B28'
						this.isShowModal = false
						this.showTip = true
					} else if (button == 1 && status == 3) { //收工
						this.isShowModal = false
						/* console.log('button',button, 'status',status, 'taskType', taskType, reward, startTime) */
						//计件收工
						// this.undoneGetToday() //计算工作时间
						// let res = await this.$fetch(this.$api.check_closing_cycle, {
						// 	orderId: orderId
						// }, 'GET')
						// if (taskType == 1) {
						// 	// this.modalStytle = 2
						// 	// this.unitPrice = reward
						// 	this.isShowModal = false
						// 	this.isShowIncome = true
						// 	this.income_reward = reward
						// 	/* 	console.log('this.modalStytle',this.modalStytle, 'this.unitPrice',this.unitPrice, ) */
						// 	//计时收工
						// } else {
						// 	this.modalStytle = 1
						// 	this.calWorkTime(startTime) //计时工作时间
						// 	this.workPrice = reward //工作单价
						// }
						// /**
						//  * 收工检测
						//  * 未到时间，收工需要雇主同意
						//  */
						// if (levelsd == 2) { //判断是否二级雇主
						// 	this.getToday() //计算工作时间
						// 	if (taskEndTime > this.toDay) { //结束
						// 		this.jobleve = 1
						// 	}
						// }
						// this.titleContect = '确认收工'
						// this.leftContext = '取消'
						// this.rightContext = '确认'
						// this.order_detail()
						this.undoneGetToday() //计算工作时间
						let res = await this.$fetch(this.$api.check_closing_cycle, {
							orderId: orderId
						}, 'GET')
						if (res.data) {
							//计件收工
							if (taskType == 1) {
								// this.modalStytle = 2
								// this.unitPrice = reward.divide(100)
								// console.log(888888)
								this.isShowModal = false
								this.isShowIncome = true
								console.log(this.isShowIncome)
								this.income_reward = reward
								if (floorsstr == 1) {
									this.is_baodi_work = true
									let start = new Date(startTime.replace(/-/g, '/'))
									let end = this.nowTime
									let diff = end - start.getTime();
									let sec = diff / 1000 / 60 / 60;
									this.baodi_reward = Math.floor((floorsAmount / 100) * sec * 100) / 100
									// console.log('dsadsadsa', this.baodi_reward)
								} else {
									this.is_baodi_work = false
									this.baodi_reward = 0
									this.isShowBaodi_reward = false
								}
								/* 	console.log('this.modalStytle',this.modalStytle, 'this.unitPrice',this.unitPrice, ) */
								//计时收工
							} else {
								this.isShowModal = true
								this.modalStytle = 1
								this.calWorkTime(startTime) //计时工作时间
								this.workPrice = reward.divide(1) //工作单价
							}
							if (levelsd == 2) { //判断是否二级雇主
								if (taskEndTime > this.undoneToDay) { //结束时间大于当前时间
									this.jobleve = 1
								}
							}
							this.titleContect = '确认收工'
							this.leftContext = '取消'
							this.rightContext = '确认'
						} else {
							this.isShowModal = false
							this.isShouGong = true
						}
					} else if (button == 0 && status == 1) {
						/* 	console.log('取消订单') */
						this.modalStytle = 3
						this.titleContect = '取消订单'
						this.middleContext = this.quxiaoFlag == 1 ? '订单取消后无法重复报名，确认取消吗？' : this.quxiaoFlag == 2 ?
							'订单取消次数将达上限，确认取消吗？' : '订单取消次数已达上限，确认取消吗？'
						this.leftContext = '取消'
						this.rightContext = '确认'
					} else if (button == 1 && status == 1) {
						this.modalStytle = 3
						this.titleContect = '确认订单'
						this.middleContext = this.orderDetail.isOldStaff || this.orderDetail.disturbstatus == 1 ?
							'是否直接接单' : !this.orderDetail.isConfirm ? '是否拨打电话' : '是否确认接单'
						this.leftContext = '取消'
						this.rightContext = '确认'
					} else if (button == 13) {
						uni.navigateTo({
							url: '/pages/jubao/jubao?orderId=' + orderId
						})
						this.isShowModal = false
						console.log('sadasdsa', name, orderId)
					} else {
						return
					}
					//this.isShowModal = true
				} else {
					this.isShowpingjia = true
					this.pj_user_list = [detail.taskUser.updateBy, bossPhoto, orderId, 1, detail]
					// console.log(detail)
					// uni.navigateTo({
					// 	url: '/pages/comment/comment?orderId=' + orderId + '&type=' + 1
					// })
				}
			},
			//今天的时间
			getToday() {
				/* 	console.log('今天的时间') */
				this.getLocatime()
			},
			//计算工作时间
			calWorkTime(startTime) {
				let Time = new Date(startTime.replace(/-/g, '/'));
				let timestemp = Time.getTime(); //开工时间
				let Timeday = new Date(this.toDay.replace(/-/g, '/'));
				let timestempday = this.nowTime ? this.nowTime : new Date().getTime() //当前时间
				let xjian = (timestempday - timestemp) / 1000 / 60
				this.workTime = xjian && xjian > 0 ? xjian.toFixed(2) : 0
			},
			//弹框左键
			handleLeft() {
				this.isShowModal = false
			},
			// 获取用户输入的件数
			handleInput(value) {
				/* console.log(value) */
				// this.count = value
				if (this.count > 100000) {
					uni.showToast({
						title: '最大件数不能大于10万件哦',
						icon: 'none'
					})
					this.$nextTick(function() {
						this.count = 100000
					})
				} else {
					this.count ? this.income_money = Math.floor((parseFloat(this.count) * parseFloat(this.income_reward)) *
						100) / 100 : 0
					if (this.taskDetail.floorsstr == 1) {
						let start = new Date(this.orderDetail.startTime.replace(/-/g, '/'))
						let end = this.nowTime
						let diff = end - start.getTime();
						let sec = diff / 1000 / 60 / 60;
						this.baodi_reward = Math.floor((this.taskDetail.floorsAmount / 100) * sec * 100) / 100
						this.isShowBaodi_reward = this.baodi_reward > this.income_money
						console.log(this.isShowBaodi_reward)
					}
				}
			},
			// 获取用户当前的经纬度并且开工
			getLocationAndWork() {
				return new Promise((resolve) => {
					uni.getLocation({
						type: 'gcj02',
						success: async (res) => {
							uni.setStorageSync('location', [res.latitude, res.longitude]);
							let resObj = await this.$fetch(this.$api.order_user_start_worker, {
								orderId: this.id,
								lat: res.latitude,
								lng: res.longitude,
								file: this.qiniuyunFile
							}, 'POST')
							if (this.isFace === '1') {
								uni.hideLoading()
								if (resObj.code) {
									if (resObj.code == -99) {
										this.$store.commit('changeKaigongCode', -99)
									} else {
										uni.showToast({
											title: resObj.msg,
											icon: 'none'
										})
									}
									if (![-90, -99].includes(resObj.code)) {
										setTimeout(() => {
											uni.switchTab({
												url: `/pages/index/index`
											})
										}, 500)
									}
									return;
								}
								setTimeout(() => {
									uni.switchTab({
										url: `/pages/index/index`
									})
								}, 500)
							} else {
								if (resObj.code) {
									uni.showToast({
										title: resObj.msg,
										icon: 'none'
									})
									resolve(false);
									return;
								}
							}
							uni.setStorageSync('receivedTaskStartTime', '')
							resolve(true);
						},
						fail: async () => {
							await this.getLocationAndWork();
						}
					})
				})
			},
			//弹框右键
			async handleRight(status) {
				this.isShowModal = false
				if (status == 0) {
					//强制收工,扣积分
					let resData = await this.$fetch(`${this.$api.confirm_closing_cycle}?orderId=${this.id}`, {}, 'GET')
					if (resData.code) return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}
				// console.log('弹框右键',this.button, this.clickStatus)
				// console.log('button',this.button, 'clickStatus',this.clickStatus,)
				if (this.button == 0 && this.clickStatus == 7) { //拒绝
					let res = await this.$fetch(this.$api.order_user_refuse_invite, {
						orderId: this.id
					}, 'POST')
					if (res.code) return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					uni.$emit('closeWorking', {})
					uni.$emit('closeDaikgong', {})
				} else if (this.button == 0 && this.clickStatus != 7 && this.clickStatus != 1) { //取消
					let res = await this.$fetch(this.$api.order_user_cancel, {
						orderId: this.id
					}, 'POST')
					if (res.code) return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					uni.$emit('closeWorking', {})
					uni.$emit('closeDaikgong', {})
					uni.setStorageSync('receivedTaskStartTime', '')
					if (uni.getStorageSync('checked1')) {
						Voice("您的任务已取消")
					}
					this.isShowSealAlert = false
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/cancellationOrder/cancellationOrder?orderId=' + this.id
						})
					}, 800)
				} else if (this.button == 1 && this.clickStatus == 2) { //开工
					console.log('aaaaaaaaaaaaaaa')
					if (this.isFace === '1') {
						if (!uni.getStorageSync('isFirstFace')) {
							uni.navigateTo({
								url: '/pages/clock/clock',
							})
							uni.setStorageSync('isFirstFace', true)
						} else {
							uni.navigateTo({
								url: `/pages/clock/face/face?orderId=${this.id}`
							})
						}
					} else {
						await this.getLocationAndWork();
						uni.$emit('openWorking', {})
						uni.$emit('closeDaikgong', {})
					}
				} else if (this.button == 1 && this.clickStatus == 3) { //收工
					if (this.jobType == 1) {
						this.isShowIncome = true
						if (this.jobType == 1 && this.count == 0) return uni.showToast({
							title: '请输入件数~',
							icon: 'none'
						})
					}
					let res = await this.$fetch(this.$api.order_user_end, {
						orderId: this.id,
						status: 1,
						count: parseInt(this.count)
					}, 'POST')
					if (res.code) return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					uni.$emit('closeWorking', {})
					uni.$emit('closeDaikgong', {})
					//请与雇主当面收工，结算工资后，再离开现场。
					if (uni.getStorageSync('checked1')) {
						Voice("您已收工，结算工资后再离开现场")
					}
				} else if (this.button == 1 && this.clickStatus == 7) { //同意
					let res = await this.$fetch(this.$api.order_user_confirm_invite, {
						orderId: this.id
					}, 'POST')
					if (res.code) return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					uni.$emit('openDaikgong', {})
					uni.$emit('closeWorking', {})
				} else if (this.clickStatus == 1) { //取消订单或者确认订单
					let checkStatus = this.button == 1 ? 2 : 0
					if (checkStatus == 0) {
						this.quxiaoFlag++
						uni.setStorageSync('quxiaoFlag', [uni.getStorageSync('date'), this.quxiaoFlag])
					}
					if (checkStatus == 0 || this.orderDetail.isConfirm || this.orderDetail.isOldStaff || this
						.orderDetail.disturbstatus == 1) {
						let res = await this.$fetch(this.$api.apply_check, {
							orderId: this.id,
							checkStatus: checkStatus
						}, 'POST')
						if (res.code) return uni.showToast({
							title: res.msg,
							icon: 'none'
						})
						uni.setStorageSync('hasUnconfirm', 0)
						if (checkStatus == 0) {
							uni.navigateTo({
								url: '/pages/cancellationOrder/cancellationOrder?orderId=' + this.id
							})
						}
						/* console.log('获取接单语音提醒状态~~~~~订单详情页——取消或确认订单',uni.getStorageSync('hasUnconfirm')) */
					} else if (!this.orderDetail.isConfirm) {
						// this.phone_bind_middle_number(this.getPhone,this.currentTaskReceived[4])
						let receivedInfoList = uni.getStorageSync('ReceivedInfo') ? uni.getStorageSync(
							'ReceivedInfo') : []
						if (receivedInfoList.length > 0) {
							receivedInfoList.forEach((v, index) => {
								if (v[0] == this.orderDetail.taskId) {
									receivedInfoList[index][1] = true
								}
							})
							uni.setStorageSync('ReceivedInfo', receivedInfoList)
						}
						this.handleMakePhoneCall()
					} else {
						uni.showToast({
							title: 'error',
							icon: 'none'
						})
					}
				} else {
					return
				}
				this.order_detail()
			},
			// 配置数据
			async getRate() {
				let res = await this.$fetch(this.$api.property_list_by_type, {
					type: 1
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				//收取雇员百分之手续费
				uni.setStorageSync('user_amount_ratio', res.data.user_amount_ratio)
				this.rate = res.data.user_amount_ratio * 100
				// 雇员取消订单扣除诚信值
				uni.setStorageSync('order_user_cancel_cut_integrity', res.data.order_user_cancel_cut_integrity)
				this.order_user_cancel_cut_integrity = uni.getStorageSync('order_user_cancel_cut_integrity')
				// 雇员取消订单不可接单时间
				uni.setStorageSync('order_user_cancel_cut_integrity', res.data.order_user_cancel_cut_integrity)
				this.x_hours_no_order = uni.getStorageSync('x_hours_no_order')
			},
			//拒绝邀请
			async refuseInvite() {
				let res = await this.$fetch(this.$api.order_user_refuse_invite, {
					orderId: this.id
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			},
			//取消订单
			async quxiaoDingdan() {
				let res = await this.$fetch(this.$api.apply_check, {
					orderId: orderId,
					checkStatus: 0
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			},
			//判断实行什么方法
			estimateExecute(status) {
				switch (status) {
					case 1:
						this.quxiaoDingdan()
						break;
					case 2:
						this.refuseInvite()
						break;
					default:
						break;
				}
			},
			//邀请倒计时
			invitationCountDown(time, status) {
				let date = new Date(time.replace(/-/g, '/'))
				let time1 = Date.parse(date) / 1000
				let time2 = time1 + (status == 2 ? 480 : status == 1 ? 480 : 0)
				let time3 = Date.parse(new Date()) / 1000
				let time4 = (time2 - time3)
				let time5 = ''
				if (this.timer == '') {
					this.timer = setInterval(() => {
						time4 = time4 - 1
						time5 = ((Math.floor(time4 / 60 % 60) < 10 ? '0' + Math.floor(time4 / 60 % 60) : Math
							.floor(time4 / 60 % 60)) + ':' + (Math.floor(time4 % 60) < 10 ? '0' + Math
							.floor(time4 % 60) : Math.floor(time4 % 60)))
						//console.log(time5)
						if ((Math.floor(time4 / 60 % 60)) <= 0 && (Math.floor(time4 % 60)) <= 0) {
							//console.log(Math.floor(time4 / 60 % 60))
							this.estimateExecute(status)
							clearInterval(this.timer)
							return
						}
						this.countDown = time5
					}, 1000)
				}
				return ' '
			},
			income_click() {
				if (!this.count || this.count[0] == '0') {
					uni.showToast({
						title: '请正确输入件数后点击确认',
						icon: 'none'
					})
				} else {
					this.handleRight()
					this.close_ShowIncome()
				}
			},
			close_ShowIncome() {
				this.isShowIncome = false
				this.count = ''
				this.baodi_reward = 0
				this.isShowBaodi_reward = false
				this.income_money = 0
			},
			closePj() {
				this.isShowpingjia = false
				this.order_detail()
			},
			autoPlay() {
				this.nn--;
				if (this.nn == 0) {
					this.getToday()
					this.calWorkTime(this.orderDetail.startTime)
					this.nn = 10;
				}
			},
			refresh1() {
				if (this.timer2 == "") {
					this.timer2 = setInterval(this.autoPlay, 1000);
				} else {
					clearInterval(this.timer2);
					this.timer2 = "";
					this.nn = 10;
				}
			}
		},
		onLoad(options) {
			this.id = options.id
			this.imgPath = uni.getStorageSync('imgPath')
			uni.setStorageSync('shuaxin', true)
			if (uni.getStorageSync('quxiaoFlag')) {
				this.quxiaoFlag = isToDay(uni.getStorageSync('quxiaoFlag')[0]) ? uni.getStorageSync('quxiaoFlag')[1] : 1
			}
			getSealDay().then((v) => {
				this.sealDay = v
			})
			this.expel_time = parseInt(uni.getStorageSync('property_list_by_type').staff_expel_time)
			this.order_detail()
			this.locationTime = setInterval(() => {
				this.refreshLocation()
			}, 1000)
		},
		onShow() {
			uni.$on('closeKgR', this.closeKgR)
			this.order_detail()
			this.showTip = false
			this.getRate()
			this.getLocatime()
			this.property_list_by_type_and_key()
		},
		onPullDownRefresh() {
			this.refresh()
		},
		destroyed() {
			console.log('destroyed')
			clearInterval(this.timer2);
		},
		onUnload() {
			console.log('清除计时器')
			if (this.timer !== '') {
				clearInterval(this.timer)
			}
			clearInterval(this.locationTime)
		},
		onShareAppMessage() {
			return {
				title: "在家找日结兼职，工种齐全",
				desc: "免费使用，提前在家找日结兼职",
				path: `/pages/start-n/start-n`,
				imageUrl: 'https://images.linglinggong.net/static/employee-share.jpg',
				success: res => {}
			}
		}
	}
</script>
<style lang="less">
	.container {
		border-top: 1px solid #FCC928; //不能删，ios会报损
		border-bottom: 1px solid #FCC928; //不能删，ios会报损
		border-bottom-color: rgba(252, 201, 40, 0); //不能删，ios会报损

		&>.order-status {
			font-size: 22px;
			line-height: 60rpx;
			padding: 20rpx 0 114rpx 30rpx;
			background-color: #FCC928;
			display: flex;
			align-items: center;

			&>text {
				padding-left: 30%;
				font-size: 16px;
			}

			&>view {
				width: 240rpx;
				height: 48rpx;
				background: #000000;
				border-radius: 6rpx;
				line-height: 48rpx;
				opacity: 0.7;
				color: #FFF;
				font-size: 24rpx;
				font-weight: 400;
				text-align: center;
				margin-left: 20rpx;
			}
		}

		&>.main {
			margin-top: -84rpx;

			&>.info {
				z-index: 1;
				margin: 0rpx 30rpx 30rpx;
				padding: 30rpx;
				border-radius: 7px;
				background-color: #FFFFFF;

				&>.title {
					margin-bottom: 20rpx;
					height: 40rpx;
					font-weight: bold;
				}
			}

			&>.employer-area {
				&>.employer-info {
					padding-bottom: 30rpx;
					margin: 0rpx 0 30rpx;
					border-bottom: 1px solid #F2F2F2;
					display: flex;
					align-items: center;
					justify-content: space-between;

					&>view {
						display: flex;

						&>image {
							width: 108rpx;
							height: 108rpx;
							border-radius: 50%;
							margin-right: 30rpx;
						}

						&>view {
							display: flex;
							// justify-content: center;
							flex-direction: column;

							&>view:first-child {
								display: flex;
								align-items: center;
								// justify-content: center;
								margin-bottom: 20rpx;

								&>text {
									margin-right: 8rpx;
									height: 48rpx;
									font-size: 17px;
								}

								&>image {
									align-self: flex-end;
									width: 26rpx;
									height: 26rpx;
								}
							}

							&>view:last-child {
								// border: 1px solid #007AFF;
								height: 40rpx;
								display: flex;
								align-items: center;

								text:first-child {
									//margin-right: 30rpx;
									color: rgba(64, 33, 16, 0.70);
								}

								text:last-child {
									font-weight: bold;
								}
							}
						}
					}

					&>view:last-child {
						flex-direction: column;
						text-align: right;

						&>text:first-child {
							margin-bottom: 2rpx;
							height: 34rpx;
							font-size: 12px;
							color: rgba(64, 33, 16, 0.70);
						}

						&>text:last-child {
							height: 60rpx;
							font-weight: bold;
							font-size: 22px;
							color: #F39B19;
						}
					}
				}

				&>.buttons {
					display: flex;
					justify-content: space-between;

					&>.button {
						display: flex;
						align-items: center;
						justify-content: center;
						width: 300rpx;
						height: 80rpx;
						background-color: #F39B19;
						border-radius: 4px;
					}

					&>.button:first-child {
						background-color: #FCC928;
					}
				}
			}

			&>.job-info {
				&>.job-detail {
					border-bottom: 1px solid #F2F2F2;
					padding-bottom: 30rpx;

					&>view {
						display: flex;
						margin-bottom: 20rpx;

						&>image {
							height: 36rpx;
							width: 36rpx;
						}

						text {
							letter-spacing: 0;
						}

						text:first-child {
							white-space: nowrap;
							margin-right: 30rpx;
							color: rgba(64, 33, 16, 0.50);
						}

						text:last-child {
							display: flex;
						}
					}

					&>view:last-child {
						margin-bottom: 0rpx;
					}
				}

				&>.job-name {
					margin-top: 30rpx;

					&>view {
						font-weight: bold;
						font-size: 17px;
						letter-spacing: 0;
					}

					&>.task-reward {
						margin-top: 20rpx;
						color: #FF650C;
					}

					&>.subsidy {
						font-weight: bold;
						font-size: 17px;
						color: #4E9800;
					}
				}

				&>.tip {
					border-top: 1px solid #F2F2F2;
					margin-top: 30rpx;
					padding-top: 30rpx;

					text {
						font-size: 14px;
						color: rgba(64, 33, 16, 0.50);
						letter-spacing: 0;
					}

					&>view {
						margin-bottom: 20rpx;
					}
				}
			}

			&>.order-info {
				.xi-gs {
					width: 200rpx;
					border: 1px solid #F39B19;
					display: flex;
					justify-content: center;
					align-items: center;
					height: 55rpx;
					border-radius: 10rpx;
					color: #F39B19;
				}

				&>view {
					// margin-bottom: 20rpx;
					height: 40rpx;

					text {
						letter-spacing: 0;
					}

					text:first-child {
						margin-right: 30rpx;
						color: rgba(64, 33, 16, 0.50);
					}
				}

				&>view:last-child {
					margin-bottom: 0rpx;
				}
			}
		}

		&>.fix-buttons {
			// border: 1px solid #000000;
			z-index: 10rpx;
			position: fixed;
			width: 100vw;
			height: 100rpx;
			bottom: 0;
			display: flex;
			justify-content: center;
			align-items: center;
			background-color: #FFFFFF;

			.nullListMsg {
				// width: 460rpx;
				// height: 105rpx;
				position: absolute;
				// border: 1px solid;
				right: 5%;
				top: -92%;
				text-align: center;
				z-index: 501;

				&>view:nth-child(1) {
					width: 300rpx;
					height: 70rpx;
					letter-spacing: 2rpx;
					background: #000000;
					opacity: 0.5;
					border-radius: 10rpx;
					color: #ffffff !important;
					font-size: 26rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				&>view:nth-child(2) {
					width: 0;
					height: 0;
					border-left: 10rpx solid transparent;
					border-right: 10rpx solid transparent;
					border-top: 10rpx solid #000000;
					opacity: 0.5;
					position: fixed;
					left: 80%;
					transform: translateX(-50%);
				}
			}

			&>.button {
				flex: 1;
				height: 100%;
				font-size: 16px;
				display: flex;
				align-items: center;
				justify-content: center;

				&:active {
					opacity: 0.7;
				}
			}

			.button:nth-child(1) {
				// border: 1px solid rgba(64,33,16,0.50);
				// margin-right: 30rpx;
				color: rgba(64, 33, 16, 0.50);
			}

			.button:nth-child(2) {
				// border: 1px solid #F39B19;
				// color: #FFFFFF;
				// background-color: #F39B19;
			}

			.button:nth-child(3) {
				// border: 1px solid #F39B19;
				color: #FFFFFF;
				background-color: #F39B19;
			}
		}
	}

	.anim-dingwei {
		animation: 2s dingwei 0s infinite;
	}

	@keyframes dingwei {
		0% {
			transform: translateY(0);
		}

		30% {
			transform: translateY(-15rpx);
		}

		40% {
			transform: translateY(0);
		}

		50% {
			transform: translateY(-10rpx);
		}

		70% {
			transform: translateY(0rpx);
		}

		80% {
			transform: translateY(-5rpx);
		}

		100% {
			transform: translateY(0);
		}
	}

	.floorsstr-view {
		width: 184rpx;
		height: 34rpx;
		background: #EFF6E7;
		border-radius: 4rpx;
		font-size: 24rpx;
		font-weight: 500;
		color: #599E10;
		line-height: 24rpx;
		margin-left: 12rpx;
		padding: 5rpx 12rpx;
	}

	.fg {
		font-size: 24rpx;
		color: #7F7F7F;
		line-height: 49rpx;
		margin: 0 20rpx;
	}

	.cx {
		font-size: 24rpx;
		font-weight: 400;
		color: #7F7F7F;
		line-height: 49rpx;

		&>text:nth-last-child(1) {
			color: #FE4B28;
			margin-left: 8rpx;
		}
	}

	.cxDiv {
		display: flex;
		flex-direction: row;
	}

	.sex-nan {
		width: 73rpx;
		height: 32rpx;
		background: #1CAAEA;
		border-radius: 4rpx;
		margin-left: 8rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 20rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 20rpx;
	}

	.sex-nv {
		width: 73rpx;
		height: 32rpx;
		background: #F90865;
		border-radius: 4rpx;
		margin-left: 8rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 20rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 20rpx;
	}

	.sex-image {
		width: 17rpx;
		height: 17rpx;
	}

	.mask {
		background-color: rgba(0, 0, 0, .5);
		width: 100vw;
		height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 998;
	}

	.mask2 {
		.income-content {
			width: 630rpx;
			height: 470rpx;
			background: #FFFFFF;
			justify-content: space-between;
		}

		.income-content-text-button {
			border: none;
			height: auto;
			display: flex;
			justify-content: space-between;
			padding-bottom: 30rpx;
		}

		.income-content-text {
			font-size: 40rpx;
			font-weight: 800;
			color: #262626;
			line-height: 0rpx;
		}

		.income-content-text2 {
			font-size: 28rpx;
			color: #515151;
			font-weight: bold;
		}

		.income-content-baodi-view {
			color: #EE1F1F;
			font-weight: bold;
			font-size: 28rpx;
			background: #fff
		}

		.income-content-text-button-ok2 {
			width: 254rpx;
			height: 94rpx;
			background: #F1F1F5;
			text-align: center;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			opacity: 1;
			font-size: 24rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #7F7F7F;
			line-height: 94rpx;
			color: #262626;
			font-size: 24rpx;
		}

		.income-content-text-button-cancel {
			width: 254rpx;
			height: 94rpx;
			background: #FCC92D;
			box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(252, 201, 45, 0.3);
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			opacity: 1;
			font-size: 28rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			line-height: 94rpx;
		}
	}

	.income-content {
		width: 600rpx;
		// height: 480rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.income-content-text {
		font-size: 36rpx;
		font-weight: bold;
		color: #000000;
		margin: 60rpx 0;
	}

	.income-content-text-title {
		width: 528rpx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		margin-bottom: 32rpx;
	}

	.income-content-text-danjai {
		font-size: 32rpx;
		font-weight: 500;
		color: #7F7F7F;
		margin-right: 35rpx;
	}

	.income-content-text-jiage {
		font-size: 32rpx;
		font-weight: 500;
		color: #000000;
	}

	.income-content-text-input {
		width: 140rpx;
		height: 30rpx;
		margin-left: 23rpx;
	}

	.income-content-text-input-view {
		width: 223rpx;
		height: 60rpx;
		border: 1px solid #787878;
		border-radius: 4rpx 0px 0px 4rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #000000;
		line-height: 60rpx;
	}

	.income-content-text-zongji {
		font-size: 32rpx;
		font-weight: 500;
		color: #FF4600;
	}

	.income-content-text-button {
		width: 600rpx;
		height: 80rpx;
		border-top: 1rpx solid #BDBDBD;
		display: flex;
		flex-direction: row;
	}

	.income-content-text-button-cancel {
		width: 299rpx;
		height: 80rpx;
		border-right: 1rpx solid #BDBDBD;
		font-size: 32rpx;
		font-weight: 500;
		color: #787878;
		line-height: 80rpx;
		text-align: center;
	}

	.income-content-text-button-ok {
		width: 300rpx;
		height: 80rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #F39B19;
		line-height: 80rpx;
		text-align: center;
	}

	.income-content-baodi-view {
		width: 527rpx;
		height: 48rpx;
		background-color: #FDE4E4;
		border-radius: 24rpx;
		text-align: center;
		font-size: 24rpx;
		font-weight: 500;
		color: #FF4600;
		line-height: 48rpx;
		margin-bottom: 52rpx;
	}

	.fix-button2 {
		background: #F2F2F2 !important;
		width: 110rpx;
		height: 76rpx;

		&>.button {
			font-size: 40rpx !important;
			color: #000000 !important;
			background: #F2F2F2 !important;
		}
	}

	.buttonText {
		position: absolute;
		width: 132rpx;
		height: 76rpx;
		top: -60rpx;
		left: 50%;
		margin-left: -66rpx;
		border-radius: 4rpx;
		background: #fff;
		font-size: 28rpx;
		line-height: 76rpx;
		text-align: center;
		bbox-shadow: 1rpx 1rpx 1rpx #A5A5A5;
		box-shadow: 0rpx 4rpx 12rpx 2rpx rgba(72, 76, 84, 0.2);
		color: #515151;
	}

	.buttonText:after {
		content: '';
		position: absolute;
		bottom: -16rpx;
		left: 50%;
		z-index: 1;
		display: block;
		margin-left: -16rpx;
		width: 0;
		border-color: #FFF transparent;
		border-style: solid;
		border-width: 16rpx 16rpx 0 16rpx;
	}

	.shougong {
		background: #fff;
		height: 616rpx;
		border-radius: 24rpx;
		width: 100%;

		&-title {
			text-align: center;
			margin: 41rpx 0 16rpx 0;
			font-size: 40rpx;
			font-weight: 800;
			color: #262626;
		}

		&-tip {
			font-size: 28rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #F85A41;
			text-align: center;
		}

		&-form {
			display: flex;
			margin: 0 14rpx;
			display: flex;
			justify-content: space-between;
			height: 120rpx;
			align-items: center;

			&-text {
				font-size: 32rpx;
				font-weight: 400;
				color: #1A1A1A;
				margin-left: 28rpx;
			}

			&-input {
				height: 80rpx;
				background: #FFFFFF;
				text-align: center;
				display: flex;
				justify-content: center;
				align-items: center;

				&-o {
					width: 138rpx;
					height: 80rpx;
					background: #FFFFFF;
					border-radius: 6rpx 6rpx 6rpx 6rpx;
					opacity: 1;
					outline: none;
					border: 2rpx solid #515151;
					margin-right: 30rpx;
				}
			}
		}

		&-footer {
			display: flex;
			justify-content: space-between;

			&>view:nth-child(1) {
				width: 224rpx;
				height: 88rpx;
				border-radius: 12rpx 12rpx 12rpx 12rpx;
				opacity: 1;
				border: 2rpx solid #7F7F7F;
				text-align: center;
				line-height: 88rpx;
				color: #515151;
			}

			&>view:nth-child(2) {
				width: 420rpx;
				height: 88rpx;
				background: #FCC928;
				box-shadow: 2rpx 12rpx 24rpx 2rpx rgba(252, 201, 40, 0.4);
				border-radius: 12rpx 12rpx 12rpx 12rpx;
				color: #262626;
				line-height: 88rpx;
				text-align: center;
				color: #262626;
				font-size: 36rpx;
			}
		}
	}

	.shougong-footer {
		display: flex;
		justify-content: space-around;
	}

	.btn-text2 {
		margin-top: -45rpx;
	}

	.shougong-form {
		margin: 0 32rpx;
	}

	.fix-buttons-lahei {
		font-size: 28rpx;
		font-weight: 400;
		color: #7F7F7F;
		display: flex;
		justify-content: space-around;
		// position: fixed;
		width: 100vw;
		margin: 6vh auto 2vh auto;

		// bottom: 68rpx;
		&>view {
			display: flex;
			justify-content: center;
			align-items: center;
			border: 2rpx solid #7F7F7F;
			width: 260rpx;
			height: 88rpx;
			border-radius: 12rpx;
		}
	}
</style>